import request from '@/utils/request'

// 查询场站特殊用户关联表管理列表
export function listSpecialConsumer(param) {
  return request({
    url: '/business/specialConsumer/getUserList',
    method: 'get',
    params: param
  })
}

// 查询场站特殊用户关联表管理详细
export function getSpecialConsumer(id) {
  return request({
    url: '/business/specialConsumer/' + id,
    method: 'get'
  })
}

// 新增场站特殊用户关联表管理
export function addSpecialConsumer(data) {
  return request({
    url: '/business/specialConsumer',
    method: 'post',
    data: data
  })
}

// 修改场站特殊用户关联表管理
export function updateSpecialConsumer(data) {
  return request({
    url: '/business/specialConsumer',
    method: 'put',
    data: data
  })
}

// 删除场站特殊用户关联表管理
export function delSpecialConsumer(id) {
  return request({
    url: '/business/specialConsumer/' + id,
    method: 'delete'
  })
}

// 搜索特殊用户
export function searchUser(id) {
  return request({
    url: '/business/specialConsumer/user/' + id,
    method: 'get'
  })
}

// 余额充值
export function balancePay(data) {
  return request({
    url: '/business/specialConsumer/updateAccount',
    method: 'put',
    data: data
  })
}

// 清空余额
export function clearAccount(consumerAccountId) {
  return request({
    url: '/business/specialConsumer/clearAccount/' + consumerAccountId,
    method: 'get'
  })
}


//通过手机号查询用户名称
export function searchUserPhone(phone) {
  return request({
    url: `/business/specialConsumer/userPhone/${phone}`,
    method: 'get'
  })
}
